home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
progjour
/
1991
/
06
/
pen.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-15
|
496b
|
29 lines
class HPENCLASS
{
HPEN hPen;
HPEN hOldPen;
HDC hDC;
public:
HPENCLASS(HDC hDCPrm, int nPenStyle, int nWidth, COLORREF crColor)
{
hDC = hDCPrm;
hPen = NULL;
hOldPen = NULL;
if (hDC)
{
hPen = CreatePen (nPenStyle, nWidth, crColor);
if (hPen)
hOldPen = SelectObject (hDC, hPen);
}
};
~HPENCLASS()
{
if (hDC && hOldPen)
SelectObject (hDC, hOldPen);
if (hPen)
DeleteObject (hPen);
};
};